home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 April / EnigmA AMIGA RUN 06 (1996)(G.R. Edizioni)(IT)[!][issue 1996-04][Skylink CD V].iso / progs / utilgfx / chaospro / rexx / calcpics < prev    next >
Text File  |  1995-11-23  |  2KB  |  85 lines

  1. /* Calculate all pictures contained in a directory */
  2. options results
  3. address rexx
  4. ADDLIB ("rexxsupport.library")
  5. ADDRESS command
  6. requestfile 'ChaosPro:' 'TITLE="Choose a fractal data directory"' DRAWERSONLY 'PUBSCREEN=ChaosPro-Fractalscreen' '> t:delme2'
  7. ADDRESS ChaosPro.Rexx
  8. ChoiceRequest "Format" "2x2|3x3|4x4|Abort"
  9. if rc=8 then exit
  10. format=result
  11. ADDRESS command
  12. success = OPEN("quak","t:delme2","Read")
  13. /* war es erfolgreich? */
  14. line =  Readln("quak")
  15. success = close("quak")
  16. delete 't:delme2' '> nil:'
  17. if line="" then exit
  18. list line 'lformat="%s%s"' '> t:delme'
  19. success = OPEN("filelist","t:delme","Read")
  20. if success=0 then exit
  21. cnt=0
  22. do forever
  23.   line = READLN("filelist")
  24.   if line="" then break
  25.   cnt=cnt+1
  26. end
  27. success = close("filelist")
  28. if format=1 then do
  29.    num_horiz=2
  30.    num_vert=2
  31.    end
  32. if format=2 then do
  33.    num_horiz=3
  34.    num_vert=3
  35.    end
  36. if format=3 then do
  37.    num_horiz=4
  38.    num_vert=4
  39.    end
  40.  
  41. success = OPEN("filelist","t:delme","Read")
  42. if success=0 then exit
  43. x=0
  44. y=0
  45. w=10000/num_horiz
  46. h=10000/num_vert
  47. address ChaosPro.Rexx
  48. PicNum=0
  49. do forever
  50.   line = READLN("filelist")
  51.   if line="" then break
  52.   LoadPicData line
  53.   Picture.PicNum=result
  54.   if rc=0 then
  55.     CalcFract Picture.PicNum x y w h
  56.   x=x+w
  57.   if x+w>10000 then do
  58.    x=0
  59.    y=y+h
  60.    end
  61.   PicNum=PicNum+1
  62.   if y+h>10000 then do
  63.      x=0
  64.      y=0
  65.      ChoiceRequest "Continue?" "Yes|Abort"
  66.      if result=0 then do
  67.        close("filelist")
  68.        address command
  69.        delete 't:delme' '> nil:'
  70.        exit
  71.      end
  72.      PicNum=PicNum-1
  73.      do while PicNum>=0
  74.         DelPicture Picture.PicNum
  75.         PicNum=PicNum-1
  76.      end
  77.      PicNum=0
  78.   end
  79. end
  80. lab1:
  81. success = close("filelist")
  82. address command
  83. delete 't:delme' '> nil:'
  84. exit
  85.